package cate.game.role.res.holy_pet.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBHolyPet;
import easy.java.dev.note.NoteField;

/**
 * 灵宠-开始派遣任务 请求
 *
 * @author ShenSL
 * @since 2023/8/26 15:51
 */
@ClientMsg(title = "灵宠-开始派遣任务 请求")
public class HolyPetStartMissionReq implements MsgInput {
    @NoteField("场景ID")
    public int sceneId;
    @NoteField("派遣灵宠ID")
    public int petId;

    @Override
    public MsgConfig conf() {
        return MsgIdBHolyPet.START_MISSION_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = cc.getRole().getRes().holyPet.startSceneMission(sceneId, petId);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        } else {
            cc.getRole().getRes().holyPet.noticeUpdate();
        }
    }
}
